package GOrden.mobile;

import java.util.ArrayList;
import java.util.List;


import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;

public class GOrdenActivity extends ListActivity {
    /** Called when the activity is first created. */
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        
        /* 
        TextView imei = (TextView)findViewById(R.id.imei);
        
        TelephonyManager tm = (TelephonyManager) getSystemService(this.TELEPHONY_SERVICE);
        String device_id = tm.getDeviceId();
        imei.setText("IMEI: " + device_id.toString() );
       */
        List<Lista> menu = new ArrayList<Lista>();
        menu.add(new Lista("Mis Ordenes", "Listado de las ordenes asignadas"));
        menu.add(new Lista("Mi ubicacion", "Ubicacion del dispositivo movil"));
        menu.add(new Lista("Terminar", "Salir de la Aplicacion"));
        
        
        AdaptadorTitulares adaptador =
                new AdaptadorTitulares(this,menu);
         
        
        setListAdapter(adaptador);
        //ListView lstOpciones = (ListView)findViewById(R.id.LstOpciones);
        
    }
    
    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        // TODO Auto-generated method stub
        super.onListItemClick(l, v, position, id);
        Log.e("NoSoloUnix","Has seleccionado el elemento "+position);
        switch (position) {
        case 0:
        	Intent intent = new Intent(this, ListOrdenActivity.class);
        	startActivity(intent);
        break;
        case 1:
        	Intent intent2 = new Intent(this, MapaActivity.class);
        	startActivity(intent2);
        break;
        case 2:
        	System.exit(0);
        	break;
        
        
        }
    }
    
    
}